package cn.fantasy.linkedList;

public class Node<E> {
    /**
     * 数据域
     */
    private E elem;

    /**
     * 指针域
     */
    private Node<E> next;

    /**
     * 构造方法
     *
     * @param elem
     * @param next
     */
    public Node(E elem, Node<E> next) {
        this.elem = elem;
        this.next = next;
    }

    /**
     * 无参构造方法
     */
    public Node() {
        this(null, null);
    }

    public E getElem() {
        return elem;
    }

    public void setElem(E elem) {
        this.elem = elem;
    }

    public Node<E> getNext() {
        return next;
    }

    public void setNext(Node<E> next) {
        this.next = next;
    }
}
